#ifndef _GAME_MAIN_SCENE_H_
#define _GAME_MAIN_SCENE_H_
#include "cocos2d.h"
#include "Hero.h"
#include "HeroBullet.h"
#include "Enemy.h"

USING_NS_CC;

enum EGameMainSceneTag
{
	EGameMainSceneTagBg1 = 1,
	EGameMainSceneTagBg2 = 2,
	EGameMainSceneTagBack =3,
	EGameMainSceneTagMenu = 4,
};


class GameMainScene : public CCLayer
{
public:
	GameMainScene();
	~GameMainScene();

	virtual bool init();
	CREATE_FUNC(GameMainScene);

	virtual void onEnter();
	virtual void onExit();
	virtual void update(float date);

	void menuBackCallBack(CCObject* pSender);
	void bg1MoveToCallBack(CCNode* pSeneder);
	void bg2MoveToCallBack(CCNode* pSeneder);

	void releaseBullets(float dt);
	void releaseBulletsCallBack(CCNode* pSeneder);

	void releaseEnemyBullets(float dt);
	void releaseEnemyBulletsCallBack(CCNode* pSender);

	void enemyAttack(float dt );

	static CCScene* scene();
	void setHurt();
	bool isInRect(CCNode* node1, CCNode* node2);

	void setGameOver();

	void setBloodProcess(int blood);


private:
	CCSprite* bg1;
	CCSprite* bg2;
	CCLabelAtlas* m_scoreLabelAtlas;
	CCLabelBMFont* m_maxScroeLabelBMFont;
	CCLabelBMFont* m_scoreLabelBMFont;
	Hero* hero;
	int m_score;
	CCArray* m_hero_bullets;
	CCArray* m_enemy;
	int m_enemy_num;
	CCSprite* m_gameOver;
	bool m_isGameOver;
	CCProgressTimer* processTimer;
	CCLabelTTF* m_scoreLabel;
	

};

#endif